{% extends 'admin/common/base.html' %}
{% import "admin/macros/_patination.html" as page_macros %}
{% block content %}
<div class="container">
    <div class="row">
        <div>
        <h3>友情列表</h3> <a href="{{url_for('admin.friendlylink_add')}}">添加</a>
        </div>
        <table class="table table-bordered">
            <thead>
              <tr>
                <th scope="col">#</th>
                <th scope="col">名称</th>
                <th scope="col">链接</th>
                <th scope="col">显示/隐藏</th>
                <th scope="col">操作</th>
              </tr>
            </thead>
            <tbody>
              {% for c in friendlylinks.items %}
              <tr>
                <th scope="row">{{c.id}}</th>
                <td>{{ c.name }}</td>
                <td>{{c.link}}</td>
                <td>{{'显示' if c.state else '隐藏'}}</td>
                <td>
                    <a href="{{url_for('admin.friendlylink_edit',id=c.id)}}"
                    class="btn btn-outline-primary btn-sm">修改</a>
                    <!-- <a href="" class="btn btn-outline-danger btn-sm">删除</a> -->
                </td>
                    
              </tr>
              {% endfor %}
            </tbody>
          </table>
    </div>
    {{ page_macros.pagination_widget(friendlylinks, 'admin.friendlylinks') }}
</div>
{% endblock %}